package com.zhiqian.community.dao;

import com.zhiqian.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
@SuppressWarnings("all")
public interface CommentMapper {

    List<Comment> selectCommentsByEntity(@Param("entityType") Integer entityType,@Param("entityId") Integer entityId,@Param("offset") int offset,@Param("limit") int limit);

    int selectCommentCountByEntity(@Param("entityType")Integer entityType,@Param("entityId")Integer entityId);

    int insertComment(Comment comment);

    int selectCommentCountByUserId(Integer userId);

    List<Comment> selectUserComments(@Param("userId") Integer userId,@Param("offset") int offset,@Param("limit") int limit);

    Comment selectCommentById(Integer commentId);

    int updateCommentStatus(@Param("status") Integer status,@Param("postId")Integer postId);
}
